package com.tjhzzx.hnceCore2024.enums;

import javax.baja.sys.BFrozenEnum;
import javax.baja.sys.Sys;
import javax.baja.sys.Type;

/**
 * @author Luc
 * @date 2019-11-14 22:13
 */
public final class BModuleType extends BFrozenEnum {
    public static final int DASHBOARD = 0;
    public static final int HISTORY = 1;
    public static final int ALARM = 2;
    public static final int TREE_MENU = 3;
    public static final int PAGE = 4;
    public static final int IMAGE = 5;
    public static final int TEXT = 6;
    public static final int FILE = 7;
    public static final int URL = 8;

    public static final BModuleType dashboard = new BModuleType(0);
    public static final BModuleType history = new BModuleType(1);
    public static final BModuleType alarm = new BModuleType(2);
    public static final BModuleType treeMenu = new BModuleType(3);
    public static final BModuleType page = new BModuleType(4);
    public static final BModuleType image = new BModuleType(5);
    public static final BModuleType text = new BModuleType(6);
    public static final BModuleType file = new BModuleType(7);
    public static final BModuleType url = new BModuleType(8);
//    public static final BModuleType url = new BModuleType(5);

    public static final BModuleType DEFAULT = treeMenu;

    public BModuleType(int ordinal) {
        super(ordinal);
    }

    public static BModuleType make(int ordinal) {
        return (BModuleType) treeMenu.getRange().get(ordinal, false);
    }

    public static BModuleType make(String tag) {
        return (BModuleType) treeMenu.getRange().get(tag);
    }

    public static String expose() {
        return "{\"DASHBOARD\":0, \"HISTORY\":1, \"ALARM\":2, \"TREE_MENU\":3, \"PAGE\":4, \"IMAGE\":5, \"TEXT\":6, \"FILE\":7, \"URL\":8}";
    }

    @Override
    public Type getType() {
        return TYPE;
    }

    public static final Type TYPE = Sys.loadType(BModuleType.class);
}
